package com.cloud.charts4a.util;

import android.util.Log;

/**
 * Log Utility<p/>
 * 
 * @version
 * <ol>
 * 	<li>2010/07/09 CloudTu：First Release</li>
 * </ol>
 * 
 * @author Cloud Tu
 */
public class LogUtil {

	private LogUtil(){		
	}
	
	/**
	 * Log a message object with the DEBUG  level. 
	 * 
	 * @param clazz		The name of clazz will be used as the name of the logger to retrieve.	
	 * @param message	the message object to log.
	 */
	public static void debug(Class<?> clazz,String message){
		Log.d(clazz.getName(), message);
	}
	
	/**
	 * Log a message object with the INFO  Level.
	 * 
	 * @param clazz		The name of clazz will be used as the name of the logger to retrieve.	
	 * @param message	the message object to log.
	 */
	public static void info(Class<?> clazz,String message){
		Log.i(clazz.getName(), message);
	}
	
	/**
	 * Log a message object with the WARN  Level.
	 * 
	 * @param clazz		The name of clazz will be used as the name of the logger to retrieve.	
	 * @param message	the message object to log.
	 */
	public static void warn(Class<?> clazz,String message){
		Log.w(clazz.getName(), message);
	}
	
	/**
	 * Log a message with the WARN level including the stack trace of the Throwable t passed as parameter. 
	 * 
	 * @param clazz		The name of clazz will be used as the name of the logger to retrieve.	
	 * @param message	the message object to log.
	 * @param t			the exception to log, including its stack trace.
	 */
	public static void warn(Class<?> clazz,String message,Throwable t){
		Log.w(clazz.getName(), message,t);
	}		
	
	/**
	 * Log a message object with the ERROR  Level. 
	 * 
	 * @param clazz		The name of clazz will be used as the name of the logger to retrieve.	
	 * @param message	the message object to log.
	 */
	public static void error(Class<?> clazz,String message){
		Log.e(clazz.getName(), message);
	}
	
	/**
	 * Log a message object with the ERROR level including the stack trace of the Throwable t passed as parameter. 
	 * 
	 * @param clazz		The name of clazz will be used as the name of the logger to retrieve.
	 * @param message	the message object to log.
	 * @param t			the exception to log, including its stack trace.
	 */
	public static void error(Class<?> clazz,String message,Throwable t){
		Log.e(clazz.getName(), message,t);
	}	
}
